/**
 * 
 */
package com.toncen.samepms.tree;

import java.util.List;

import com.toncen.samepms.common.AbstractTreeProvider;
import com.toncen.samepms.system.dao.ModuleDao;
import com.toncen.samepms.system.domain.Module;

/**
 * @author tch
 * 
 */
public class ModuleTreeProvider extends AbstractTreeProvider<Module> {

	/**
	 * 
	 */
	public ModuleTreeProvider() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.toncen.samepms.common.AbstractTree#getRoots()
	 */
	public List<Module> getRoots() throws Exception {
		ModuleDao moduleDao = new ModuleDao();
		return moduleDao.getAllRootModule();
	}

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		ModuleTreeProvider moduleTree = new ModuleTreeProvider();
		System.out.println(moduleTree.getRoots());
	}

}
